using CodeSaude.Domain.Entities;
using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;

namespace CodeSaude.Infrastructure.Data.EntityConfig
{
    public class ServicoAtendimentoMap : EntityTypeConfiguration<ServicoAtendimento>
    {
        public ServicoAtendimentoMap()
        {
            // Primary Key
            this.HasKey(t => t.ServicoAtendimentoId);

            // Properties
            this.Property(t => t.nome_servico)
                .HasMaxLength(90);

            this.Property(t => t.icone_servico)
                .HasMaxLength(90);

            this.Property(t => t.sigla_servico)
                .HasMaxLength(3);

            // Table & Column Mappings
            this.ToTable("servico_atendimento");
            this.Property(t => t.ServicoAtendimentoId).HasColumnName("id_servico");
            this.Property(t => t.nome_servico).HasColumnName("nome_servico");
            this.Property(t => t.icone_servico).HasColumnName("icone_servico");
            this.Property(t => t.id_situacao).HasColumnName("id_situacao");
            this.Property(t => t.sigla_servico).HasColumnName("sigla_servico");
        }
    }
}
